package com.itheima.mapper.umsMapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.domain.db.ums.UmsRoleResourceRelation;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;


@Mapper
public interface UmsRoleResourceRelationMapper extends BaseMapper<UmsRoleResourceRelation> {
@Insert("INSERT into ums_role_resource_relation set resourceId where roleId='roleId'")
    void save(Integer resourceId, Integer roleId);

    @Select("SELECT resource_id from ums_role_resource_relation as u WHERE u.role_id = #{roleId}")
    List<Long> findRoleResourceListByRoleId(Long roleId);
}
